import type { LoginParam, UserInfoData } from '@/api/model/loginModel';
import { request } from '@/utils/request';

const Api = {
  Login: '/auth/login',
  UserInfo: '/auth/userInfo',
};

export function login(param: LoginParam) {
  return request.post<string>(
    {
      url: Api.Login,
      data: param,
    },
    {
      isTransformResponse: false,
    },
  );
}

export function userInfo() {
  return request.get<UserInfoData>(
    {
      url: Api.UserInfo,
    },
    {
      isTransformResponse: false,
    },
  );
}
